<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>织蝶云 - OA+PM+CRM一站式企业应用管理平台</title>
    <!-- 小图标 -->
    <link rel="shortcut icon" href="./images/favicon/favicon.ico" type="image/x-icon">
    <!-- 清除样式 -->
    <link rel="stylesheet" href="./css/resets.css">
    <!-- bootstrap的css包 -->
    <link rel="stylesheet" href="./lib/bootstrap_4/css/bootstrap.min.css">
    <!-- 模板样式css -->
    <link rel="stylesheet" href="./css/lyj_knowledge.css">
    <!-- 清除样式 -->
    <link rel="stylesheet" href="./css/resets.css">
    <!-- 引入字体图标css -->
    <link rel="stylesheet" href="./css/iconfont/lyj_iconfont/iconfont.css">
    <link rel="stylesheet" href="./css/iconfont/lyd_approval/iconfont.css">
</head>

<body>
    <div class="left_nav">
        <div class="logo">
            <a href="/tmeplate">
                <img src="./images/lyd/lyd_approval_frame_logo-left.png" alt="织蝶云">
            </a>
        </div>
        <div class="left_nav_menu">
            <ul class="left_nav_menu_nav">
                <li class="btn-block">
                    <a href="/page">
                        <i class="iconfont icon-home"></i>
                        <span>主页</span>
                    </a>
                </li>
                <li class="btn-block">
                    <a href="/mange">
                        <i class="iconfont icon-list"></i>
                        <span>项目</span>
                    </a>
                </li>
                <li class="btn-block">
                    <a href="/lyd_approval">
                        <i class="iconfont icon-suitcase"></i>
                        <span>审批</span>
                    </a>
                </li>
                <li class="btn-block">
                    <a href="/gy-CRM">
                        <i class="iconfont icon-users"></i>
                        <span>CRM</span>
                    </a>
                </li>
                <li class="btn-block">
                    <a href="javascript:;">
                        <i class="iconfont icon-calendar"></i>
                        <span>日程</span>
                    </a>
                </li>
                <li class="btn-block">
                    <a href="javascript:;">
                        <i class="iconfont icon-tasks"></i>
                        <span>报告</span>
                    </a>
                </li>
                <li class="btn-block">
                    <a href="javascript:;">
                        <i class="iconfont icon-book"></i>
                        <span>知识</span>
                    </a>
                </li>
                <li class="btn-block">
                    <a href="/document">
                        <i class="iconfont icon-columns"></i>
                        <span>文档</span>
                    </a>
                </li>
                <li class="btn-block">
                    <a href="/resume">
                        <i class="iconfont icon-male"></i>
                        <span>简历</span>
                    </a>
                </li>
                <li class="btn-block">
                    <a href="javascript:;">
                        <i class="iconfont icon-tupian"></i>
                        <span>相册</span>
                    </a>
                </li>
                <li class="btn-block">
                    <a href="javascript:;">
                        <i class="iconfont icon-bull-horn-announcer"></i>
                        <span>公告</span>
                    </a>
                </li>
                <li class="btn-block">
                    <a href="javascript:;">
                        <i class="iconfont icon-gavel"></i>
                        <span>考勤</span>
                    </a>
                </li>
                <li class="btn-block">
                    <a href="/yyl_system">
                        <i class="iconfont icon-cogs"></i>
                        <span>系统</span>
                    </a>
                </li>
            </ul>
        </div>
    </div>
    <div class="top_nav_box">
        <div class="top_nav">
            <a class="toggle-btn">
                <i class="iconfont icon-bars"></i>
            </a>
            <div class="top_center">
                <a href="/lyj_knowledge" class="btn btn-all">我的知识</a>
                <a href="/lyj_knowledge_show" class="btn btn-all actives">全部知识</a>
                <a href="/lyj_knowledge_set" class="btn btn-all">分类设置</a>
            </div>
            <div class="top_right">
                <ul class="top_right_info">
                    <li>
                        <a href="javascript:;" class="btn info_icon">
                            <i class="iconfont icon-envelope-o"></i>
                        </a>
                        <div class="nav_switch_off">
                            <h5>你有0条信息</h5>
                            <ul>
                                <li>目前还没有最新消息</li>
                                <li>
                                    <a href="javascript:;">查看更多</a>
                                </li>
                            </ul>
                        </div>
                    </li>
                    <li>
                        <!-- <a href="javascript:;" class="admi">
                            <img src="./images/lyd/6.jpg" alt="管理员">
                            管理员
                            <span class="iconfont icon-caret-bottom"></span>
                        </a> -->
                        <ul class="nav_switch_off">
                            <li><a href="javascript:;"><i class="iconfont icon-xx"></i>个人主页</a></li>
                            <li><a href="javascript:;"><i class="iconfont icon-xx"></i>基本资料</a></li>
                            <li><a href="javascript:;"><i class="iconfont icon-xx"></i>更换头像</a></li>
                            <li><a href="javascript:;"><i class="iconfont icon-xx"></i>更换密码</a></li>
                            <li><a href="javascript:;"><i class="iconfont icon-xx"></i>我的任务</a></li>
                            <li><a href="javascript:;"><i class="iconfont icon-xx"></i>升级为付费版</a></li>
                            <li><a href="javascript:;"><i class="iconfont icon-xx"></i>订单</a></li>
                            <li><a href="javascript:;"><i class="iconfont icon-xx"></i>聊天</a></li>
                            <li><a href="/outlogin"><i class="iconfont icon-SignOut"></i>退出</a></li>
                        </ul>
                    </li>
                </ul>
            </div>
        </div>
        <div class="content-box">
            <div class="content">
                <!-- 顶部搜索 -->
                <div class="top_search">
                    <!-- 分享知识 -->
                    <div class="top_search_add">
                        <a href="/lyj_knowledge_add">
                            <i class="iconfont icon-plus"></i>
                            分享知识
                        </a>
                    </div>
                    <!-- 筛选 -->
                    <div class="top_search_screen">
                        <form action="">
                            <input type="text" placeholder="请输入标题、标签">
                            <button class="btn" type="button"><i class="iconfont icon-search
                                "></i>筛选</button>
                        </form>
                    </div>
                </div>
                <!-- 中间内容 -->
                <div class="middle">
                    <div class="middle_content clearfix">
                        <!-- 显示数据 -->
                        <div class="middle_new clearfix">
                            <div class="middle_new_div_show">
                                <script type="text/template" id="temp2">
                                <!-- 标题 -->
                                {{each list}}
                                <h1 class="show_title">
                                    <a href="javascript:;">{{ $value.title }}</a>
                                </h1>
                                <!-- 用户名 -->
                                <p class="show_yhm clearfix">
                                    <img src="./images/lyj/0.jpg" alt="">
                                    <a href="javascript:;">略略略</a>
                                    <span class="show_yhm_rigth">
                                        <i class="iconfont icon-eye"></i>1
                                        <i class="iconfont icon-heart"></i>0
                                        <i class="iconfont icon-comments-o"></i>0
                                    </span>
                                </p>
                                <!-- 简介 -->
                                <p class="">{{$value.intro}}</p>
                                <i class="iconfont icon-arrowcircleoright"></i>
                                <a href="javascript:;" class="show_read">
                                    继续阅读
                                </a>

                                <!-- 操作 -->
                                <p class="show_cz">
                                    <a href="/lyj_knowledge_add2?id={{$value.id}}" title="编辑" class="cz_compile show_cz_compile compile2" data-id="{{$value.id}}">
                                        <i class="iconfont icon-edit"></i>编辑
                                    </a>
                                    <a href="javascript:;" title="删除" class="cz_compile show_cz_delete cancel2" data-id="{{$value.id}}">
                                        <i class="iconfont icon-times"></i>删除
                                    </a>
                                </p>
                            </div>
                            {{/each}}
                            </script>
                            </div>
                            <div class="middle_new_all">
                                共
                                <span>0</span>
                                条
                            </div>
                        </div>
                        <!-- 分类 -->
                        <div class="middle_classify">
                            <div class="middle_classify_content">
                                <h3>分类</h3>
                                <ul id="ul2">
                                    <script type="text/template" id="temp3">
                                            <!-- <li>
                                                <i class="iconfont icon-angle-right"></i>
                                                <a href="">
                                                    市场营销
                                            </a>
                                            </li>
                                            <li>
                                                <i class="iconfont icon-angle-right"></i>
                                                <a href="">
                                                    运营
                                            </a>
                                            </li>
                                            <li>
                                                <i class="iconfont icon-angle-right"></i>
                                                <a href="">
                                                    随笔
                                            </a>
                                            </li> -->
                                            {{each list}}
                                            <li>
                                                <i class="iconfont icon-angle-right"></i>
                                                <a href="" data-id="{{$value.id}}" class="angle">
                                                    {{ $value.name}}
                                                </a>
                                                </li>
                                            {{/each}}
                                     </script>
                                </ul>
                            </div>
                        </div>
                        <!-- 版权 -->
                    </div>
                    <footer>
                        2020 © by 织蝶云系统 ·
                        <a href="">织蝶云手册</a>
                        ·
                        <a href="">翌羽信息科技(上海)有限公司 版权所有</a>
                    </footer>
                </div>
            </div>
        </div>



        <!-- 引入jquery -->
        <script src="./lib/jquery/jquery.min.js"></script>
        <!-- 引入bootstrap的js -->
        <script src="./lib/bootstrap_4/js/bootstrap.min.js"></script>
        <!-- 模板样式js -->
        <script src="./js/lyj_knowledge.js"></script>
        <!-- 引入模板 -->
        <script src="./lib/template/template.js"></script>
        <!-- 引入字体图标js -->
        <script src="./js/iconfont/lyd_approval/iconfont.js"></script>
        <script src="./js/iconfont/lyj_iconfont/iconfont.js"></script>

        <script>
            // 显示数据
            let show = () => {
                $.ajax({
                    type: 'get',
                    url: '/showUser2',
                    data: '',
                    success: function (result) {
                        console.log(result)
                        let str = template('temp2', {
                            list: result
                        })
                        $('.middle_new_div_show').html(str)
                    }
                })
                $.ajax({
                    type: 'get',
                    url: '/showUser4',
                    data: '',
                    success: function (result) {
                        console.log(result)
                        let str = template('temp3', {
                            list: result
                        })
                        $('#ul2').html(str)

                    }
                })
            }
            show();

            // 删除
            $('.middle_new_div_show').on('click', '.cancel2', function () {
                let id = $(this).attr('data-id')
                console.log(id);
                $.ajax({
                    type: 'get',
                    url: '/delUser2',
                    data: {
                        id: id
                    },
                    beforeSend: function () {
                        let flag = confirm('您确定要删除吗？');
                        if (!flag) {
                            return false;
                        }
                    },
                    success: function (result) {
                        if (result.code == '1301') {
                            alert(result.message)
                            show()
                        }
                    }
                })
            })



            // 编辑
            $('tbody').on('click', '.compile2', function () {
                let userId = $(this).attr('data-id');
                $.ajax({
                    type: 'post',
                    url: '/userUpdate2',
                    data: userId,
                    success: function (result) {
                        // console.log(data);
                        if (result.code == '1302') {
                            show()
                        }
                    }
                })
            })

        </script>
</body>

</html>